package com.payment.ktb.Fragment;

import android.app.Dialog;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.android.volley.VolleyError;
import com.payment.ktb.Interface.AlertInterface;
import com.payment.ktb.Interface.HttpCallbackListener;
import com.payment.ktb.R;
import com.payment.ktb.activity.LoginActivity;
import com.payment.ktb.activity.StartActivity;
import com.payment.ktb.activity.main4.AddSettleBankCardDetailActivity;
import com.payment.ktb.activity.main4.AddSettleBankcardActivity;
import com.payment.ktb.activity.main4.AgentActivity;
import com.payment.ktb.activity.main4.AgentOrderActivity;
import com.payment.ktb.activity.main4.AgentStatDay;
import com.payment.ktb.activity.main4.ApplyAgentActivity;
import com.payment.ktb.activity.main4.CardWrapActivity;
import com.payment.ktb.activity.main4.CardWrapEmptyActivity;
import com.payment.ktb.activity.main4.InviteCodeActivity;
import com.payment.ktb.activity.main4.MembershipCenterActivity;
import com.payment.ktb.activity.main4.OrderCenterActivity;
import com.payment.ktb.activity.main4.PersionalinfoActivity;
import com.payment.ktb.activity.main4.RealNameVerificationActivity;
import com.payment.ktb.activity.main4.SettingActivty;
import com.payment.ktb.activity.main4.UseInstructionsActivity;
import com.payment.ktb.constants.Constants;
import com.payment.ktb.constants.ConstantsUser;
import com.payment.ktb.constants.HttpActions;
import com.payment.ktb.constants.HttpUrls;
import com.payment.ktb.utils.AlertDialogUtils;
import com.payment.ktb.utils.HttpUtils;
import com.payment.ktb.utils.LogUtil;
import com.payment.ktb.utils.SharedPreferencesUtils;
import com.payment.ktb.utils.ToastUtils;
import com.squareup.picasso.Picasso;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.File;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


/**
 * Created by syd on 2016/6/2.
 */
public class Fragment_main4 extends BaseFragment implements View.OnClickListener{

    View view;
    TextView tv_main4_username;
    TextView tv_main4_phone;
    RelativeLayout rl_main4_setting;
    RelativeLayout rl_main4_userinfo_arrorright;
    ImageView iv_main4_header;
    ImageView iv_main4_myheadvip;
    File file;
    TextView tv_main4_vip_notes;
    TextView tv_main4_certification_notes;
    TextView tv_main4_settlecard_notes;
    LinearLayout ll_main4_membershipcenter;
    LinearLayout ll_main4_order;
    LinearLayout ll_main4_nameandphone;
    LinearLayout ll_main4_cardwrap;
    LinearLayout ll_main4_invatecode;
    LinearLayout ll_main4_phone;
    LinearLayout ll_main4_realnameverification;
    LinearLayout ll_main4_settlebankcard;
    LinearLayout ll_main4_instructions;
    LinearLayout ll_main4_agent;
    String timestamp = String.valueOf(new Date().getTime());
    boolean isBindSettleCard = false;
    String userStatus = "";
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_main4,container,false);
        file = new File(Environment.getExternalStorageDirectory(), SharedPreferencesUtils.getString(ConstantsUser.phone) + "avatar.png");

        initView();


        return view;
    }

    /**
     *
     */
    private void initView() {

        tv_main4_username = (TextView) view.findViewById(R.id.tv_main4_username);
        tv_main4_phone = (TextView) view.findViewById(R.id.tv_main4_phone);
        rl_main4_setting = (RelativeLayout) view.findViewById(R.id.rl_main4_setting);
        rl_main4_setting.setOnClickListener(this);
        rl_main4_userinfo_arrorright = (RelativeLayout) view.findViewById(R.id.rl_main4_userinfo_arrorright);
        rl_main4_userinfo_arrorright.setOnClickListener(this);
        iv_main4_header = (ImageView) view.findViewById(R.id.iv_main4_portrait);
        iv_main4_myheadvip = (ImageView) view.findViewById(R.id.iv_main4_myheadvip);
        tv_main4_vip_notes = (TextView) view.findViewById(R.id.tv_main4_vip_notes);
        tv_main4_certification_notes = (TextView) view.findViewById(R.id.tv_main4_certification_notes);
        tv_main4_settlecard_notes = (TextView) view.findViewById(R.id.tv_main4_settlecard_notes);
        ll_main4_order = (LinearLayout) view.findViewById(R.id.ll_main4_order);
        ll_main4_order.setOnClickListener(this);
        ll_main4_settlebankcard = (LinearLayout) view.findViewById(R.id.ll_main4_settlebankcard);
        ll_main4_settlebankcard.setOnClickListener(this);
        ll_main4_cardwrap = (LinearLayout) view.findViewById(R.id.ll_main4_cardwrap);
        ll_main4_cardwrap.setOnClickListener(this);
        ll_main4_membershipcenter = (LinearLayout) view.findViewById(R.id.ll_main4_membershipcenter);
        ll_main4_membershipcenter.setOnClickListener(this);
        ll_main4_realnameverification = (LinearLayout) view.findViewById(R.id.ll_main4_realnameverification);
        ll_main4_realnameverification.setOnClickListener(this);
        ll_main4_invatecode = (LinearLayout) view.findViewById(R.id.ll_main4_invatecode);
        ll_main4_invatecode.setOnClickListener(this);
        ll_main4_phone = (LinearLayout) view.findViewById(R.id.ll_main4_phone);
        ll_main4_phone.setOnClickListener(this);
        ll_main4_nameandphone = (LinearLayout) view.findViewById(R.id.ll_main4_nameandphone);
        ll_main4_nameandphone.setOnClickListener(this);
        ll_main4_instructions = (LinearLayout) view.findViewById(R.id.ll_main4_instructions);
        ll_main4_instructions.setOnClickListener(this);
        ll_main4_agent = (LinearLayout) view.findViewById(R.id.ll_main4_agent);
        ll_main4_agent.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            //会员中心
            case R.id.ll_main4_membershipcenter:

                if (!TextUtils.isEmpty(SharedPreferencesUtils.getString(ConstantsUser.userToken))){
                    getVipInfo();
                } else {
                    getActivity().startActivity(new Intent(getActivity(),LoginActivity.class));
                    getActivity().overridePendingTransition(R.anim.activity_open,0);
                }


                break;
            //实名认证
            case R.id.ll_main4_realnameverification:


                if (!TextUtils.isEmpty(SharedPreferencesUtils.getString(ConstantsUser.userToken))){
                    startActivity(new Intent(getActivity(), RealNameVerificationActivity.class));
                } else {
                    getActivity().startActivity(new Intent(getActivity(),LoginActivity.class));
                    getActivity().overridePendingTransition(R.anim.activity_open,0);
                }

                break;
            //结算卡
            case R.id.ll_main4_settlebankcard:


                if (!TextUtils.isEmpty(SharedPreferencesUtils.getString(ConstantsUser.userToken))){

                    if (tv_main4_certification_notes.getText().toString().equals("审核通过") && !isBindSettleCard) {
                        Intent intent = new Intent(mContext,AddSettleBankcardActivity.class);
                        intent.putExtra("httpActionType","UserSettleCardBindState");
                        startActivity(intent);
                    }else if (tv_main4_certification_notes.getText().toString().equals("审核通过") && isBindSettleCard) {
                        getBindCardInfo();
                    }else {
                        ToastUtils.showToast("请先通过实名认证！");
                    }


                } else {
                    getActivity().startActivity(new Intent(getActivity(),LoginActivity.class));
                    getActivity().overridePendingTransition(R.anim.activity_open,0);
                }



                break;
            //个人信息
            case R.id.rl_main4_userinfo_arrorright:



                if (!TextUtils.isEmpty(SharedPreferencesUtils.getString(ConstantsUser.userToken))){
                    startActivity(new Intent(getActivity(), PersionalinfoActivity.class));
                } else {
                    getActivity().startActivity(new Intent(getActivity(),LoginActivity.class));
                    getActivity().overridePendingTransition(R.anim.activity_open,0);
                }

                break;
            //设置
            case R.id.rl_main4_setting:


                if (!TextUtils.isEmpty(SharedPreferencesUtils.getString(ConstantsUser.userToken))){
                    startActivity(new Intent(getActivity(), SettingActivty.class));
                } else {
                    getActivity().startActivity(new Intent(getActivity(),LoginActivity.class));
                    getActivity().overridePendingTransition(R.anim.activity_open,0);
                }


                break;
            //订单
            case R.id.ll_main4_order:


                if (!TextUtils.isEmpty(SharedPreferencesUtils.getString(ConstantsUser.userToken))){
                    startActivity(new Intent(getActivity(), OrderCenterActivity.class));
                } else {
                    getActivity().startActivity(new Intent(getActivity(),LoginActivity.class));
                    getActivity().overridePendingTransition(R.anim.activity_open,0);
                }

                break;
            //邀请码
            case R.id.ll_main4_invatecode:
                startActivity(new Intent(getActivity(), InviteCodeActivity.class));
                break;
            //卡卷包
            case R.id.ll_main4_cardwrap:

                if (!TextUtils.isEmpty(SharedPreferencesUtils.getString(ConstantsUser.userToken))){
                    getVouchersInfo();
                } else {
                    getActivity().startActivity(new Intent(getActivity(),LoginActivity.class));
                    getActivity().overridePendingTransition(R.anim.activity_open,0);
                }

                break;
            //客服电话
            case R.id.ll_main4_phone:
                AlertDialogUtils.showAlertDialog(getActivity(), "400-101-8258", "取消", "呼叫", new AlertInterface() {
                    @Override
                    public void confirm(Dialog alertDialog) {
                        startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse("tel:4001018258")));
                    }
                });
                break;

            //代理商
            case R.id.ll_main4_agent:

                if (!TextUtils.isEmpty(SharedPreferencesUtils.getString(ConstantsUser.userToken))){

                    if (!userStatus.equals(ConstantsUser.USERSTATUSOK)) {
                        ToastUtils.showToast("请先完成实名认证！");
                    }else if (!isBindSettleCard){
                        ToastUtils.showToast("请先绑定结算卡！");
                    }else {
                        getAgentInfo();
                    }
                } else {
                    getActivity().startActivity(new Intent(getActivity(),LoginActivity.class));
                    getActivity().overridePendingTransition(R.anim.activity_open,0);
                }

                break;
            //登陆界面
            case R.id.ll_main4_nameandphone:
                getActivity().startActivity(new Intent(getActivity(), LoginActivity.class));
                getActivity().overridePendingTransition(R.anim.activity_open,0);
                break;

            //登陆界面
            case R.id.ll_main4_instructions:
                startActivity(UseInstructionsActivity.class);
                break;

        }
    }





    public void getAgentInfo() {



        //构造传输参数
        Map<String, String> map = new HashMap<String,String>();
        map.put("timestamp",timestamp);

        //向服务器发送请求
        HttpUtils.HttpRequestByVollery(HttpUrls.URL, HttpActions.UserOrgInfo, map, mQueue, new HttpCallbackListener() {
            @Override
            public void onFinish(String response) {
                try {
                    JSONObject jsonObject = new JSONObject(response);

                    if (jsonObject.optString("orgStatus").equals("0")) {
                        startActivity(AgentActivity.class);
                    }else if (jsonObject.optString("orgStatus").equals("9")) {
                        Intent intent = new Intent(mContext, AgentOrderActivity.class);
                        intent.putExtra("orgType",jsonObject.optString("orgType"));
                        intent.putExtra("payPrice",jsonObject.optString("payPrice"));
                        intent.putExtra("taskId",jsonObject.optString("taskId"));
                        startActivity(intent);
                    }else if (jsonObject.optString("orgStatus").equals("2")) {
                        getAgentStatDayInfo();
                    }else {
                        Intent intent = new Intent(mContext,ApplyAgentActivity.class);
                        intent.putExtra("orgStatus",jsonObject.optString("orgStatus"));
                        intent.putExtra("failMemo",jsonObject.optString("failMemo"));
                        intent.putExtra("userEmail",jsonObject.optString("userEmail"));
                        startActivity(intent);
                    }

                } catch (JSONException e) {
                    e.printStackTrace();
                    AlertDialogUtils.showAlertDialog(mContext, getResources().getString(R.string.json_parse_error));
                }
            }

            @Override
            public void onError(VolleyError volleyError) {
                AlertDialogUtils.showAlertDialog(mContext, volleyError.getMessage());
            }
        });


    }


    public void getBindCardInfo() {


        //构造传输参数
        Map<String, String> map = new HashMap<String,String>();
        String timestamp = String.valueOf(new Date().getTime());
        map.put("timestamp",timestamp);

        //向服务器发送请求
        HttpUtils.HttpRequestByVollery(HttpUrls.URL, HttpActions.UserSettleCardListState, map, mQueue, new HttpCallbackListener() {
            @Override
            public void onFinish(String response) {
                try {
                    JSONObject jsonObject = new JSONObject(response);
                    Intent intent = new Intent(mContext,AddSettleBankCardDetailActivity.class);
                    intent.putExtra("cardNo",jsonObject.optString("cardNo"));
                    intent.putExtra("cardBank",jsonObject.optString("cardBank"));
                    intent.putExtra("cardCnaps",jsonObject.optString("cardCnaps"));
                    intent.putExtra("cardPic",jsonObject.optString("cardPic"));
                    startActivity(intent);

                } catch (JSONException e) {
                    e.printStackTrace();
                    AlertDialogUtils.showAlertDialog(mContext, getResources().getString(R.string.json_parse_error));
                }
            }

            @Override
            public void onError(VolleyError volleyError) {
                AlertDialogUtils.showAlertDialog(mContext, volleyError.getMessage());
            }
        });
    }
    @Override
    public void onResume() {
        super.onResume();

        //获取用户基本信息
        if (TextUtils.isEmpty(SharedPreferencesUtils.getString(ConstantsUser.userToken))) {
            iv_main4_header.setImageResource(R.mipmap.my_head_portrait_grey);
            tv_main4_username.setText("登录/注册");
            ll_main4_nameandphone.setEnabled(true);
            tv_main4_phone.setVisibility(View.GONE);
            iv_main4_myheadvip.setVisibility(View.GONE);
        }else {
            tv_main4_phone.setVisibility(View.VISIBLE);
            ll_main4_nameandphone.setEnabled(false);
            getUserBasicInfo();
        }
    }




    //获取用户基本信息
    public void getUserBasicInfo() {


        //构造传输参数
        Map<String, String> map = new HashMap<String,String>();
        map.put("timestamp",timestamp);

        //向服务器发送请求
        HttpUtils.HttpRequestByVollery(HttpUrls.URL, HttpActions.UserBaseInfoState, map, mQueue, new HttpCallbackListener() {
            @Override
            public void onFinish(String response) {
                try {
                    JSONObject jsonObject = new JSONObject(response);

                    SharedPreferencesUtils.putString(ConstantsUser.userNick,jsonObject.optString(ConstantsUser.userNick));
                    SharedPreferencesUtils.putString(ConstantsUser.birthday,jsonObject.optString(ConstantsUser.birthday));
                    SharedPreferencesUtils.putString(ConstantsUser.sex,jsonObject.optString(ConstantsUser.sex));
                    SharedPreferencesUtils.putString(ConstantsUser.userStatusCn,jsonObject.optString(ConstantsUser.userStatusCn));
                    SharedPreferencesUtils.putString((SharedPreferencesUtils.getString(ConstantsUser.phone) + ConstantsUser.userStatus),jsonObject.optString(ConstantsUser.userStatus));
                    SharedPreferencesUtils.putString(ConstantsUser.userAccount,jsonObject.optString(ConstantsUser.userAccount));
                    SharedPreferencesUtils.putString(ConstantsUser.userCert,jsonObject.optString(ConstantsUser.userCert));
                    SharedPreferencesUtils.putString(ConstantsUser.userBank,jsonObject.optString(ConstantsUser.userBank));
                    SharedPreferencesUtils.putString(ConstantsUser.inviteUrl,jsonObject.optString(ConstantsUser.inviteUrl));
                    SharedPreferencesUtils.putString(SharedPreferencesUtils.getString(ConstantsUser.phone) + ConstantsUser.PIC1, jsonObject.optString("pic1"));
                    SharedPreferencesUtils.putString(SharedPreferencesUtils.getString(ConstantsUser.phone) + ConstantsUser.PIC2, jsonObject.optString("pic2"));
                    SharedPreferencesUtils.putString(SharedPreferencesUtils.getString(ConstantsUser.phone) + ConstantsUser.PIC3, jsonObject.optString("pic3"));
                    SharedPreferencesUtils.putString(SharedPreferencesUtils.getString(ConstantsUser.phone) + ConstantsUser.PIC4, jsonObject.optString("pic4"));
                    SharedPreferencesUtils.putString(SharedPreferencesUtils.getString(ConstantsUser.phone) + ConstantsUser.picHeader, jsonObject.optString("picHeader"));

                    ConstantsUser.picQr = jsonObject.optString("picQr");

                    file = new File(Environment.getExternalStorageDirectory(), SharedPreferencesUtils.getString(ConstantsUser.phone) + "avatar.png");
                    if (!TextUtils.isEmpty( SharedPreferencesUtils.getString(SharedPreferencesUtils.getString(ConstantsUser.phone) + ConstantsUser.picHeader))){
                        Picasso.with(mContext).load(SharedPreferencesUtils.getString(SharedPreferencesUtils.getString(ConstantsUser.phone) + ConstantsUser.picHeader)).fit().into(iv_main4_header);
                    }else if (file != null && file.exists()) {
                        iv_main4_header.setImageBitmap(BitmapFactory.decodeFile(file.getPath()));
                    } else {
                        iv_main4_header.setImageResource(R.mipmap.my_head_portrait);
                    }

                    userStatus = jsonObject.optString("userStatus");
                    tv_main4_username.setText(jsonObject.optString(ConstantsUser.userNick));

                    tv_main4_phone.setText(jsonObject.optString("userPhone").substring(0,3) + "****" + jsonObject.optString("userPhone").substring(7,11));

                    //会员中心
                    if (jsonObject.optInt("vipFlg") == 0) {
                        tv_main4_vip_notes.setText("未开通");
                        iv_main4_myheadvip.setVisibility(View.VISIBLE);
                        iv_main4_myheadvip.setImageResource(R.mipmap.my_head_vip_grey);
                    }else if (jsonObject.optInt("vipFlg") == 1) {
                        tv_main4_vip_notes.setText(jsonObject.optString("vipExpireDay") + "天后到期");
                        tv_main4_vip_notes.setTextColor(Color.rgb(208,37,29));
                        iv_main4_myheadvip.setVisibility(View.VISIBLE);
                        iv_main4_myheadvip.setImageResource(R.mipmap.my_head_vip);
                    }else if (jsonObject.optInt("vipFlg") == 2) {
                        tv_main4_vip_notes.setText("开通已到期");
                        iv_main4_myheadvip.setVisibility(View.VISIBLE);
                        iv_main4_myheadvip.setImageResource(R.mipmap.my_head_vip_grey);

                    }

                    //实名认证
                    if (jsonObject.optString("userStatus").equals("20")){
                        tv_main4_certification_notes.setTextColor(Color.rgb(58,142,12));
                    }
                    tv_main4_certification_notes.setText(jsonObject.optString("userStatusCn"));

                    //结算卡
                    if (TextUtils.isEmpty(jsonObject.optString("userBank"))) {
                        tv_main4_settlecard_notes.setText("待绑定");
                        isBindSettleCard = false;
                    }else {
                        tv_main4_settlecard_notes.setText("已绑定");
                        tv_main4_settlecard_notes.setTextColor(Color.rgb(58,142,12));
                        isBindSettleCard = true;
                    }



                } catch (JSONException e) {
                    e.printStackTrace();
                    AlertDialogUtils.showAlertDialog(mContext, getResources().getString(R.string.json_parse_error));
                }
            }

            @Override
            public void onError(VolleyError volleyError) {
                AlertDialogUtils.showAlertDialog(mContext, volleyError.getMessage());
            }
        });

    }


    /**
     *
     */
    public void getVipInfo() {


        //构造传输参数
        Map<String, String> map = new HashMap<String,String>();
        map.put("timestamp",timestamp);

        //向服务器发送请求
        HttpUtils.HttpRequestByVollery(HttpUrls.URL, HttpActions.UserVipInfo, map, mQueue, new HttpCallbackListener() {
            @Override
            public void onFinish(String response) {
                try {
                    JSONObject jsonObject = new JSONObject(response);

                    Intent intent = new Intent(mContext,MembershipCenterActivity.class);
                    intent.putExtra("vipRate",jsonObject.optString("vipRate"));
                    intent.putExtra("birthdayCount",jsonObject.optString("birthdayCount"));
                    intent.putExtra("isVip",jsonObject.optString("isVip"));
                    intent.putExtra("expireDay",jsonObject.optString("expireDay"));
                    intent.putExtra("meal",jsonObject.optString("meal"));
                    startActivity(intent);


                } catch (JSONException e) {
                    e.printStackTrace();
                    AlertDialogUtils.showAlertDialog(mContext, getResources().getString(R.string.json_parse_error));
                }
            }

            @Override
            public void onError(VolleyError volleyError) {
                AlertDialogUtils.showAlertDialog(mContext, volleyError.getMessage());
            }
        });
    }



    //获取卡卷包信息
    public void getVouchersInfo() {



        //构造传输参数
        Map<String, String> map = new HashMap<String,String>();
        //0:未使用 1:已使用或过期
        map.put("isUse","0");
        map.put("size","20");
        map.put("page","0");

        //向服务器发送请求
        HttpUtils.HttpRequestByVollery(HttpUrls.URL, HttpActions.UserVouchersList, map, mQueue, new HttpCallbackListener() {
            @Override
            public void onFinish(String response) {
                try {
                    JSONObject jsonObject = new JSONObject(response);

                    if (jsonObject.optInt("allCount") <= 0) {
                       startActivity(CardWrapEmptyActivity.class);
                    }else {
                        Intent intent = new Intent(mContext,CardWrapActivity.class);
                        intent.putExtra("records",jsonObject.optString("records"));
                        startActivity(intent);
                    }

                } catch (JSONException e) {
                    e.printStackTrace();
                    AlertDialogUtils.showAlertDialog(mContext, getResources().getString(R.string.json_parse_error));
                }
            }

            @Override
            public void onError(VolleyError volleyError) {
                AlertDialogUtils.showAlertDialog(mContext, volleyError.getMessage());
            }
        });


    }

    //代理商日统计信息
    public void getAgentStatDayInfo() {




        //构造传输参数
        Map<String, String> map = new HashMap<String,String>();
        map.put("timestamp",timestamp);

        //向服务器发送请求
        HttpUtils.HttpRequestByVollery(HttpUrls.URL, HttpActions.OrgStsDay, map, mQueue, new HttpCallbackListener() {
            @Override
            public void onFinish(String response) {
                try {
                    JSONObject jsonObject = new JSONObject(response);

                    Intent intent = new Intent(mContext,AgentStatDay.class);
                    intent.putExtra("unReadMsg",jsonObject.optInt("unReadMsg"));
                    intent.putExtra("dayProfit",jsonObject.optDouble("dayProfit")/100);
                    intent.putExtra("payCount",jsonObject.optString("payCount"));
                    intent.putExtra("orgType",jsonObject.optString("orgType"));
                    intent.putExtra("paySumPrice",jsonObject.optDouble("paySumPrice")/100);
                    intent.putExtra("allProfit",jsonObject.optDouble("allProfit")/100);
                    intent.putExtra("dayOrg",jsonObject.optString("dayOrg"));
                    intent.putExtra("childOrgCount",jsonObject.optString("childOrgCount"));
                    intent.putExtra("passUser",jsonObject.optString("passUser"));
                    intent.putExtra("regUser",jsonObject.optString("regUser"));
                    startActivity(intent);


                } catch (JSONException e) {
                    e.printStackTrace();
                    AlertDialogUtils.showAlertDialog(mContext, getResources().getString(R.string.json_parse_error));
                }
            }

            @Override
            public void onError(VolleyError volleyError) {
                AlertDialogUtils.showAlertDialog(mContext, volleyError.getMessage());
            }
        });


    }
}
